using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;using Maxleaf.EDI.Domain.K3;

namespace Maxleaf.EDI.DataAccess.K3
{
    public class t_ICItemCoreMap : EntityTypeConfiguration<t_ICItemCore>
    {
        public t_ICItemCoreMap()
        {
            // Primary Key
            this.HasKey(t => t.FItemID);

            // Properties
            this.Property(t => t.FItemID)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.FModel)
                .HasMaxLength(255);

            this.Property(t => t.FName)
                .IsRequired()
                .HasMaxLength(80);

            this.Property(t => t.FHelpCode)
                .HasMaxLength(50);

            this.Property(t => t.FShortNumber)
                .HasMaxLength(80);

            this.Property(t => t.FNumber)
                .HasMaxLength(80);

            this.Property(t => t.FModifyTime)
                .IsFixedLength()
                .HasMaxLength(8)
                .IsRowVersion();

            this.Property(t => t.FBrNo)
                .HasMaxLength(10);

            // Table & Column Mappings
            this.ToTable("t_ICItemCore");
            this.Property(t => t.FItemID).HasColumnName("FItemID");
            this.Property(t => t.FModel).HasColumnName("FModel");
            this.Property(t => t.FName).HasColumnName("FName");
            this.Property(t => t.FHelpCode).HasColumnName("FHelpCode");
            this.Property(t => t.FDeleted).HasColumnName("FDeleted");
            this.Property(t => t.FShortNumber).HasColumnName("FShortNumber");
            this.Property(t => t.FNumber).HasColumnName("FNumber");
            this.Property(t => t.FModifyTime).HasColumnName("FModifyTime");
            this.Property(t => t.FParentID).HasColumnName("FParentID");
            this.Property(t => t.FBrNo).HasColumnName("FBrNo");
            this.Property(t => t.FTopID).HasColumnName("FTopID");
            this.Property(t => t.FRP).HasColumnName("FRP");
            this.Property(t => t.FOmortize).HasColumnName("FOmortize");
            this.Property(t => t.FOmortizeScale).HasColumnName("FOmortizeScale");
            this.Property(t => t.FForSale).HasColumnName("FForSale");
            this.Property(t => t.FStaCost).HasColumnName("FStaCost");
            this.Property(t => t.FOrderPrice).HasColumnName("FOrderPrice");
            this.Property(t => t.FOrderMethod).HasColumnName("FOrderMethod");
            this.Property(t => t.FPriceFixingType).HasColumnName("FPriceFixingType");
            this.Property(t => t.FSalePriceFixingType).HasColumnName("FSalePriceFixingType");
            this.Property(t => t.FPerWastage).HasColumnName("FPerWastage");
            this.Property(t => t.FARAcctID).HasColumnName("FARAcctID");
            this.Property(t => t.FPlanPriceMethod).HasColumnName("FPlanPriceMethod");
            this.Property(t => t.FPlanClass).HasColumnName("FPlanClass");
        }
    }
}
